package com.acce.product.pojo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.acce.base.pojo.BasePojo;

/** 
 * @ClassName: Goods
 * @Description:  系统商品分类信息表
 * @author mahuang
 * @param <T>
 * @date 2016年7月18日 下午6:59:17 
 *  
 */
public class Goods extends BasePojo implements Serializable, Comparable<Goods>  {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6169038927479610983L;
	
	private String goodsId; //类别ID
	
	private String seafood; //海鲜类复制
	private String vegetables; //蔬菜类复制
	private String fruit; //水果类复制
	private String saleSelect; //卖家类复制
	private String buySelect; //买家类复制
	private String rawSelect; //餐饮类复制
	
	private String originalNum; //原始编号,排序号
	private String commodity; //分类名称
	private String father; //上级分类
	private String son; //下级分类
	/**
	 * commodity = 农产品时, levelNum小于等于3
	 * levelNum:
	 * 1 -- Kindom
	 * 2 -- Devision
	 * 3 -- Family
	 * */
	private String levelNum; //级别编号
	private String levelExp; //级别说明
	private String remarks; //备注说明
	private String province; //省份
	private String city; // 城市
	private String companyId; //发布公司ID
	private String companyName; //公司名称
	private String companyType; //公司类型 1.所有类型企业. 2.购销商. 3.餐饮
	private String companyDefaultState; //默认公司
	private String unit; //单位
	private String proQuantity; //批次采购商品数量
	private String goodsKingdom; //分类
	private String sequenceNum; //采购数量
	private String selected; //是否选中
	private String systemType = "company";
	
	private List<Goods> children = new ArrayList<Goods>(); //用于返回子节点json数据
	
	public String getGoodsId() {
		return goodsId;
	}
	public void setGoodsId(String goodsId) {
		this.goodsId = goodsId;
	}
	public String getSeafood() {
		return seafood;
	}
	public void setSeafood(String seafood) {
		this.seafood = seafood;
	}
	public String getVegetables() {
		return vegetables;
	}
	public void setVegetables(String vegetables) {
		this.vegetables = vegetables;
	}
	public String getFruit() {
		return fruit;
	}
	public void setFruit(String fruit) {
		this.fruit = fruit;
	}
	public String getSaleSelect() {
		return saleSelect;
	}
	public void setSaleSelect(String saleSelect) {
		this.saleSelect = saleSelect;
	}
	public String getBuySelect() {
		return buySelect;
	}
	public void setBuySelect(String buySelect) {
		this.buySelect = buySelect;
	}
	public String getRawSelect() {
		return rawSelect;
	}
	public void setRawSelect(String rawSelect) {
		this.rawSelect = rawSelect;
	}
	public String getOriginalNum() {
		return originalNum;
	}
	public void setOriginalNum(String originalNum) {
		this.originalNum = originalNum;
	}
	public String getCommodity() {
		return commodity;
	}
	public void setCommodity(String commodity) {
		this.commodity = commodity;
	}
	public String getFather() {
		return father;
	}
	public void setFather(String father) {
		this.father = father;
	}
	public String getSon() {
		return son;
	}
	public void setSon(String son) {
		this.son = son;
	}
	public String getLevelNum() {
		return levelNum;
	}
	public void setLevelNum(String levelNum) {
		this.levelNum = levelNum;
	}
	public String getLevelExp() {
		return levelExp;
	}
	public void setLevelExp(String levelExp) {
		this.levelExp = levelExp;
	}
	public String getRemarks() {
		return remarks;
	}
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	public String getProvince() {
		return province;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getCompanyId() {
		return companyId;
	}
	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}
	public String getCompanyName() {
		return companyName;
	}
	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	public String getCompanyType() {
		return companyType;
	}
	public void setCompanyType(String companyType) {
		this.companyType = companyType;
	}
	public String getCompanyDefaultState() {
		return companyDefaultState;
	}
	public void setCompanyDefaultState(String companyDefaultState) {
		this.companyDefaultState = companyDefaultState;
	}
	public List<Goods> getChildren() {
		return children;
	}
	public void setChildren(List<Goods> children) {
		this.children = children;
	}
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
	public String getProQuantity() {
		return proQuantity;
	}
	public void setProQuantity(String proQuantity) {
		this.proQuantity = proQuantity;
	}
	public String getGoodsKingdom() {
		return goodsKingdom;
	}
	public void setGoodsKingdom(String goodsKingdom) {
		this.goodsKingdom = goodsKingdom;
	}
	public String getSequenceNum() {
		return sequenceNum;
	}
	public void setSequenceNum(String sequenceNum) {
		this.sequenceNum = sequenceNum;
	}
	public String getSelected() {
		return selected;
	}
	public void setSelected(String selected) {
		this.selected = selected;
	}
	public String getSystemType() {
		return systemType;
	}
	public void setSystemType(String systemType) {
		this.systemType = systemType;
	}
	@Override
	public int compareTo(Goods o) {
		if(o != null) {
			if(this.getSon().equals(o.getSon())) {
				if(Integer.valueOf(this.getSequenceNum()) < 
						Integer.valueOf(o.getSequenceNum()))
					return -1;
				else
					return 1;
			} else {
				if(Integer.valueOf(this.getSequenceNum()) > 
						Integer.valueOf(o.getSequenceNum()))
					return 1;
				else
					return -1;
			}
		}
		return -1;
	}
	
}
